package com.chen.recruit.domain;

import com.chen.recruit.common.enums.CommonStatus;
import com.chen.recruit.common.enums.MenuType;
import com.chen.recruit.common.enums.ShowStatus;
import com.chen.recruit.common.valid.AddGroup;
import com.chen.recruit.common.valid.UpdateGroup;
import com.chen.recruit.domain.model.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 菜单对象 t_menu
 *
 * @author cgy
 * @date 2022-08-20
 */
@Data
@ApiModel("Menu 菜单对象")
@EqualsAndHashCode(callSuper = true)
public class Menu extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 菜单ID
     */
    @ApiModelProperty("菜单ID")
    @Null(message = "新增菜单ID必须为空", groups = {AddGroup.class})
    @NotNull(message = "更新菜单ID不能为空", groups = {UpdateGroup.class})
    private Integer id;

    /**
     * 菜单名称
     */
    @ApiModelProperty("菜单名称")
    @NotBlank(message = "菜单名称不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String name;

    /**
     * 父菜单ID
     */
    @ApiModelProperty("父菜单ID")
    private Integer parentId;

    /**
     * 路由地址
     */
    @ApiModelProperty("路由地址")
    private String path;

    /**
     * 组件路径
     */
    @ApiModelProperty("组件路径")
    private String component;

    /**
     * 菜单类型（D目录 M菜单 B按钮）
     */
    @ApiModelProperty("菜单类型（D目录 M菜单 B按钮）")
    @NotNull(message = "菜单类型不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private MenuType type;

    /**
     * 显示状态（1显示 0隐藏）
     */
    @ApiModelProperty("显示状态（1显示 0隐藏）")
    private ShowStatus visible;

    /**
     * 菜单状态（1启用 0禁用）
     */
    @ApiModelProperty("菜单状态（1启用 0禁用）")
    private CommonStatus status;

    /**
     * 权限标识
     */
    @ApiModelProperty("权限标识")
    private String permission;

    /**
     * 菜单图标
     */
    @ApiModelProperty("菜单图标")
    private String icon;

}
